/*
 * Copyright (c) 2025 EasyAdmin
 * All rights reserved.
 *
 * This file is part of the [EasAdmin] project.
 * Unauthorized copying of this file, via any medium, is strictly prohibited.
 * Proprietary and confidential.
 *
 * Author: EasyAdmin ( 1073602@qq.com )
 * Website: https://www.xhxiao.com
 */
package com.easy.module.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.easy.framework.common.validate.Add;
import com.easy.framework.common.validate.Update;
import com.easy.framework.database.entity.BaseEntity;
import com.easy.framework.poi.annotation.Excel;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.List;

/**
 * 应用菜单授权 实体
 *
 * @author EasyAdmin ( 1073602@qq.com )
 * @date 2025-08-20
 */
@Getter
@Setter
@TableName("sys_app_menu_auth")
public class SysAppMenuAuth extends BaseEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 编号
     */
    @Excel(name = "编号")
    @TableId(type = IdType.AUTO)
    private Long id;


    /**
     * 授权类型
     */
    @Excel(name = "授权类型")
    private Integer authType;


    /**
     * 授权编号
     */
    @Excel(name = "授权编号")
    private Long authId;


    /**
     * 菜单编号
     */
    @Excel(name = "菜单编号")
    private Long menuId;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT, value = "`created_by`")
    private Long createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT, value = "`created_at`")
    private Date createdAt;

    /**
     * 授权类型（1机构，2角色，3用户
     */
    @TableField(exist = false)
    private String authTypeDesc;

    /**
     * 授权描述
     */
    @TableField(exist = false)
    private String authDesc;

    /**
     * 创建人
     */
    @TableField(exist = false)
    private String createdByDesc;

    /**
     * 菜单编号列表
     */

    @NotNull(message = "菜单编号不能为空", groups = {Add.class})
    @Size(min = 1, message = "菜单编号不能为空", groups = {Add.class})
    @TableField(exist = false)
    private List<Long> menuIdList;
}